<?php
include_once "conn.php";
$token=$_GET['token'];
$arr=[];
$sql=$db->query("SELECT * FROM address WHERE address_default = 1 AND user_id = 
               (SELECT user_id FROM user WHERE user_token = '$token')");
while ($row = $sql->fetch_assoc()) {
   array_push($arr,$row);
}
echo json_encode($arr);
$db->close();
?>